/* Copyright (C) 2010 Luca Piccinelli
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/* 
 * File:   newfile.h
 * Author: lpiccinelli
 *
 * Created on 29 luglio 2010, 22.16
 */

#ifndef _NEWFILE_H
#define	_NEWFILE_H

#define NAMESPACE gestface

#include <iostream>
#include <typeinfo>
#include <cstdio>
#include <string>

// ****** Cross library export definitions *************************************

//#if defined(_MSC_VER)
//#   define DLL_EXPORT __declspec(dllexport)
//#   define DLL_IMPORT __declspec(dllimport)
//#elif defined(__GNUC__)
//#   define DLL_EXPORT __attribute__((visibility("default")))
//#   define DLL_IMPORT
//#   if __GNUC__ > 4
//#       define DLL_LOCAL __attribute__((visibility("hidden")))
//#   else
//#       define DLL_LOCAL
//#   endif
//#else
//#   error("Don't know how to export shared object libraries")
//#endif
//
//#ifdef BUILDING_PIPEIT_SHARED
//#   define PIPEIT_PUBLIC DLL_EXPORT
//#else
//#   define PIPEIT_PUBLIC DLL_IMPORT
//#endif

// *****************************************************************************

namespace NAMESPACE{

// ****** Global Key namespaces definitions ************************************
#define INPUT_NS    "in"
#define OUTPUT_NS   "out"
#define CRITERIA_NS "criteria"
#define PARAMETER_NS   "parameter"
// -----------------------------------------------------------------------------

// ****** Static Builder constants *********************************************
#define DEFAULT_CONSTRUCTOR "@default"
// -----------------------------------------------------------------------------

// ****** Traits for retrieving class name *************************************
template<typename T>
class TypeParseTraits{
public:
    static const std::string name(){
        return typeid(T).name();
    }
};

#define REGISTER_PARSE_TYPE(X) \
    template<> class TypeParseTraits< X > \
    { public: static const std::string name(){ return #X; } };
// -----------------------------------------------------------------------------

typedef long memory_size_t;

typedef std::size_t size_t;
typedef int         counter_t;
typedef double      prob_t;

REGISTER_PARSE_TYPE(int)
REGISTER_PARSE_TYPE(double)
REGISTER_PARSE_TYPE(float)
REGISTER_PARSE_TYPE(std::string)
REGISTER_PARSE_TYPE(memory_size_t)
REGISTER_PARSE_TYPE(int*)
REGISTER_PARSE_TYPE(double*)
REGISTER_PARSE_TYPE(float*)
REGISTER_PARSE_TYPE(std::string*)
REGISTER_PARSE_TYPE(memory_size_t*)

}

#endif	/* _NEWFILE_H */

